package com.stu.vertx.hello.designPattern.prototype;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
public class Resume implements Cloneable {           // 被克隆的类必须要实现Cloneable接口
    private String name;
    private Integer age;
    private String education;
    private String experience;

    public void show() {
        System.out.println("姓名【" + name + "】,年龄【" + age + "】,学历【" + education + "】,经验【" + experience + "】");
        System.out.println("---------------");
    }

    /**
     * 重写Object类完成对对象的克隆
     *
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    public Resume clone() throws CloneNotSupportedException {
        return (Resume) super.clone();
    }
}